#include <iostream>

using namespace std;

class animal {
protected:
        int age;
        int sex;
public:
        void set_age(int a) {age = a;}
        int get_age(void) {return age;}
        void set_sex(int s) {sex = s;}
        int get_sex(void) {return sex;}
        void eat(void) {cout << __func__ << "()" << endl;}
};

class dog : public animal {
public:
        void wang(void) {cout << __func__ << "()" << endl;}
        void print_age(void) {cout << age << endl;}
};

class cat : public animal {
public:
        void miao(void) {cout << __func__ << "()" << endl;}
};

int main()
{
        animal a;

        a.set_age(6);
        cout << a.get_age() << endl;

        dog wangcai;

        wangcai.set_age(7);
        cout << wangcai.get_age() << endl;
        wangcai.eat();
        wangcai.wang();
        //wangcai.miao();
        wangcai.print_age();

        return 0;
}
